import { Component, OnInit } from '@angular/core';
import { FlowInfoService } from './flow-info.service';
@Component({
  selector: 'app-flow-info',
  templateUrl: './flow-info.component.html',
  styleUrls: ['./flow-info.component.scss'],
  providers:[FlowInfoService]
})
export class FlowInfoComponent implements OnInit {

  // 传入的对象
  public item;

  // 单个数据的流程明细
  public singleFlowInfo: any =[];

  //传入的item类型，条目查看与修改传入'nNdId',在途模式与条目复核传入'nNjId'
  public itemType:any;
  constructor(
    public flowInfoService:FlowInfoService
  ) { }

  ngOnInit() {
    this.GetSingleInfo();
  }
  // 查询单个数据的流程明细
  GetSingleInfo(){
    let that = this;
    let getBody: any = {
      nBatchNo: that.item.nBatchNo,
      pageIndex: 0,
      pageSize: 0
    }
    if(this.itemType == 'nNdId'){
      getBody['nNjId'] = that.item.nNdId;
    }else{
      getBody['nNjId'] = that.item.nNjId;
    }
   
    console.log(this.item)
    this.flowInfoService.detail(getBody).subscribe(data => {
      if (data) {
        this.singleFlowInfo = data.list;
      }
    });
  }

}
